const addressModel = require("../../model/user/address");
async function add(req, res) {
    const data = await addressModel.add(req.body);
    const json = {
        code: data.code,
        message: data.msg,
    };
    res.send(json);
}
async function select(req, res) {
    const data = await addressModel.select(req.query.userID);
    const json = {
        code: data.code,
        message: data.msg,
        data: data.result,
    };
    res.send(json);
}
async function update(req, res) {
    const data = await addressModel.update(req.body);
    const json = {
        code: data.code,
        message: data.msg,
    };
    res.send(json);
}
async function del(req, res) {
    const data = await addressModel.del(req.body);
    const json = {
        code: data.code,
        message: data.msg,
    };
    res.send(json);
}
module.exports = {
    add,
    select,
    update,
    del,
};
